import request from '@/utils/request';

export const getAllChannelsAPI = () => {
  return request({ url: '/v1_0/channels' });
};

export const getUserChannelsAPI = () => {
  return request({ url: '/v1_0/user/channels' });
};

export const addUserChannelsAPI = (newChannel: { id: number }) => {
  return request({
    url: '/v1_0/user/channels',
    method: 'patch',
    data: {
      channels: [newChannel],
    },
  });
};

export const delUserChannelsAPI = (id: number) => {
  return request({
    url: '/v1_0/user/channels/' + id,
    method: 'delete',
  });
};
